<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人店铺首页</title>
<link href="<?php echo $this->_webroot('/style/jq-ui/jquery-ui-1.8.18.custom.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/css.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/content.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/cloud-zoom.css'); ?>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo $this->_webroot('script/jquery-1.7.1.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/jquery-ui-1.8.18.custom.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/jquery.carouFredSel-5.5.0-packed.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/cloud-zoom.1.0.2.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/js.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/content.js'); ?>"></script>

</head>

<body >
<!--
<body  onload="initialize();">
-->

<psp:tags     htmlname='shop_topnav'  iconname='shoptopnav' />
<div class="head headpadding">
    <psp:tags     htmlname='shopsearch_default'  iconname='shopsearch_default' />
    <div class="clear"></div>
</div>
<!-- nav_wrap -->
<div class="nav_wrap">
	<div class="nav_logo border_bottom1">
   	<img src="<?php if(!empty($SHOP['shop_template_img'])) {echo $SHOP['shop_template_img'];}else{echo $this->_webroot('photo/company_logo.jpg');}?>"  onerror="this.src='<?php echo $this->_webroot('photo/company_logo.jpg'); ?>'" width="998" height="154" />
    	<div class="nav1_content">
    		<ul class="nav1_ul">
                <psp:tags     htmlname='shopnav_default'  iconname='shopnav' />
            </ul>	
        
    	</div>    
    </div>
    
</div>
<!-- nav_wrap end -->

<div class="container margintop1">
	<!-- main_left -->
	<div id="main_left">
    	<!-- 供应商信息 -->
        <div class="supplier_message">
        	<div class="supplier_message_hd">
            	<span class="supplier_tab">供应商信息</span>
            </div>			
            <div class="supplier_company_message">
            	<p><span class="float1">企业名：</span><span class="supplier_company_name"><?php echo  $SHOP['shop_name'];?></span>
                	<div class="clear"></div>
                </p>
                <p>卖家昵称：<?php echo  $ranks['user']['username'];?></p>
                <p>经营模式：<?php echo  $SHOP['shop_management'];?></p>
                <p>所在地区：<?php echo  $areainfo[$SHOP['shop_province']];?>.<?php echo  $areainfo[$SHOP['shop_city']];?></p>
            </div>
            <div class="supplier_company_message">	
                   <p class="check_certificate" style="color: #A93323;margin: 0 5px 0 5px;">已认证的有效证件<br />
                   <span class="certificate<?php if($SHOPREQUEST['credit_idcard']){echo '1';}else{ echo '2';} ?>" style="color: #A93323;">法人身份证</span>
                   <span class="certificate<?php if($SHOPREQUEST['credit_businesslicense']){echo '1';}else{ echo '2';} ?>" style="color: #A93323;">营业执照</span>
                   <span class="certificate<?php if($SHOPREQUEST['credit_taxlicense']){echo '1';}else{ echo '2';} ?>" style="color: #A93323;">税务登记证</span>	
                   <span class="certificate<?php if($SHOPREQUEST['credit_organizationcode']){echo '1';}else{ echo '2';} ?>" style="color: #A93323;">组织机构</span>					   
				   </p>			
            </div>			
            <div class="supplier_company_message">
            	<p><span class="integrity_protection">诚信保障</span></p>

			<?php if($ensure) {
				foreach($ensure as $val) { $val =$val['ensure']; ?>
				    <?php if( isset( $userensure[$val['id']]) && $userensure[$val['id']]['istui']==0 ) { ?>
                        <p><span class="ensure_money"><img src="<?php echo $val['picurl']?>" /><?php echo $val['name'];?>：</span>￥<?php echo $val['money']?></p>	
                    <?php } ?>						    
				<?php }?>
			<?php }?>				

            </div>
            <div class="supplier_company_message">
            	<p class="integrity_index">诚信通指数:<span class="satisfaction_rate"><?php echo $seller_credit;?></span></p>
                <p class="integrity_index">商品满意率：<span class="satisfaction_rate"><?php echo substr("".(($goods_credit/$goods_sell)*100),0,5);?>%</span></p>
			
				
                <p><span class="satisfaction_rate"><img src="<?php echo $this->_webroot('images/member_medal1.gif');?>" width="16" height="16" class="member_medal1" />会员勋章：</span><?php echo $rank_name['rank_name'];?></p>
            </div>
            <div class="supplier_company_message border_bottom2">
            	<p><a  href="javascript:add_shopFavorite('<?php echo  $SHOP['id'];?>')"  class="location_collection"></a><span class="collection_num">收藏数：<?php echo  $SHOP['favpv'];?></span></p>                
            <input type="hidden" value="<?php echo  $this->controller->my->id;?>" id="shop_user" />
			<input type="hidden" value="<?php echo  $SHOP['id'];?>" id="shop_id" />
			<input type="hidden" value="<?php echo  $goodsinfo['goods']['favpv'];?>" id="favpv_num">
			<input type="hidden" value="<?php echo  $goodsinfo['goods']['goods_number'];?>" id="goods_number" />
			</div>
        </div>
<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js');?>"></script>
<script language="JavaScript">
	<!--
		function addFavorite(id) {
			var shop_id = document.getElementById('shop_id').value;
			var user_id = document.getElementById('shop_user').value;
			var favpv = document.getElementById('favpv_num').value;
			if (shop_id == user_id){
				alert('自己的商品不能放入收藏');
			}else {
				ajax("<?php echo $this->_url('shop/goodsfavorite');?>","POST","id="+id,function(data){
					if(data == 1) {
						var favpv_num = Number(favpv) + Number(1);
						document.getElementById('favpv').innerHTML = "<span id='favpv'>"+favpv_num+"</span>";
						alert("已成功添加到您的收藏夹！");
					} else if(data == -1) {
						alert("此商品已在您的收藏夹里！");
					} else if(data == -2){
						alert("非法操作,产品不存在");						
					} else {
						alert("添加失败，请确认您是否已登陆！");
					}
				});
			}
		}	
		function add_shopFavorite(id) {
			var user_id = document.getElementById('shop_user').value;
			if (id == user_id){
				alert('自己的店铺不能收藏');
			}else {
				ajax("<?php echo $this->_url('shop/shopfavorite');?>","POST","id="+id,function(data){
					if(data == 1) {
						alert("已成功添加到您的收藏夹！");
					} else if(data == -1) {
						alert("此商铺已在您的收藏夹");
					} else if(data == -2){
						alert("非法操作,店铺不存在");
					} else if(data == -4){
						alert("自己的店铺不能收藏");
					}else {					
						alert("添加失败，请确认您是否已登陆！");
					}
				});
			}
		}	
		function addCart(id) {
			var num = document.getElementById('num');
			var shop_id = document.getElementById('shop_id').value;
			var user_id = document.getElementById('shop_user').value;
			
			var num_reg = /^(\d+)$/;
			if(!num_reg.test(num.value)){
				alert('购买数量格式不正确!');
				return;
			}
			if(num.value=='0'){
				alert('购买数量不能为0！');
				return;
			}

			if (shop_id == user_id){
				alert('自己的商品不能放入购物车');
			}else{
				ajax("<?php echo $this->_url('shop/goodsaddcart');?>","POST","id="+id+"&num="+num.value,function(data){
					if(data == 1) {
						alert("已成功添加到您的购物车！");
					} else if(data == -1) {
						alert("此商品已在您的购物车里！");
					} else if(data == -2) {
						alert("库存里没有这么多商品！");
					} else {
						alert("添加失败，请确认您是否已登陆！");
					}
				});
			}
		}
		function gotoOrder(id) {
			var goods_number = document.getElementById('goods_number').value;
			var value = document.getElementById('num').value;			
			var shop_id = document.getElementById('shop_id').value;
			var user_id = document.getElementById('shop_user').value;			
			var num_reg = /^(\d+)$/;
			if(!num_reg.test(value)){
				alert('购买数量格式不正确!');
				return;
			}

			if (shop_id == user_id){
				alert('自己不能购买自己的商品');
			}else {
				if(parseInt(value) > parseInt(goods_number)){
					alert("购买数量应小于库存数!");
				}else {
					location.href = "<?php echo $this->_url('user/buyorderadress/');?>?gid="+id+"&v="+value;
				}
			}
		}		
</script>		
        <!-- 供应商信息 end -->
	       

        <!-- 产品分类 -->
        <div class="supplier_message margintop1">
        	<div class="supplier_message_hd">
            	<span class="supplier_tab">产品分类</span>
            </div>
		   <style>
		   .prot_cat_ul li a b.jian{
				background:url("<?php echo $this->_webroot('images/more_bg2.gif'); ?>") no-repeat;
		   }
		   </style>			
			<script>
			jQuery(function($){
				$(".kk").toggle(function(){
						$(this).siblings(".kk_siblings").slideDown().end().find("b").addClass("jian"); return false;}
					,function(){
					$(this).siblings(".kk_siblings").slideUp().end().find("b").removeClass("jian"); return false;});
			})
			</script>
            <div class="prot_cat">
                <ul class="prot_cat_ul">
            <?php  if(empty($category_list_new)){?>
                <li ><a href="#" class="kk" >本商铺还没有添加分类！</a></li>
            <?php } else {
	function get_sub_category ($category_list,$parent_id) {
		$array = array();
		foreach($category_list as $k=>$v) {
			if($v['parent_id']==$parent_id) {
				$array[$k] = $v;
			}
		}
		return $array;
	}			
                $category_0 = get_sub_category($category_list_new,0);
                foreach($category_0 as $v) {?>
                	<li>
					    <a class="kk" href="<?php echo $this->_url('shop/products/'.$SHOP['id'].'/?cat='.$value['id']);?>"><?php echo  $v['shop_cat_name'];?><b></b></a>
            <?php 
                $category_sub = get_sub_category($category_list_new,$v['id']);
                if(!empty($category_sub)){?>
						<div class="kk_siblings" style="padding-left:2em;padding-bottom:10px; width:130px; display:none">				
                <?php foreach($category_sub as $value) {?>
							<a style="height:22px;line-height:22px;" href="<?php echo $this->_url('shop/products/'.$SHOP['id'].'/?cat='.$value['id']);?>"><?php echo  $value['shop_cat_name'];?></a>
                <?php  }?>
                    </div>
                <?php  }?>
                </li>
            <?php  }?>
            <?php }?>				
				
                    <li class="last2"><a href="<?php echo $this->_url('shop/products/'.$SHOP['id']);?>">更多商品>></a></li>
                </ul>
            </div>            
        </div>
        <!-- 产品分类 end -->
        
        <!-- 联系方式 -->
        <div class="supplier_message margintop1">
        	<div class="supplier_message_hd">
            	<span class="supplier_tab">联系方式</span>
            </div>
            <div class="contact_way_wap">
            	<p>联&nbsp;&nbsp;系人：<?php echo $SHOP['person_name'];?></p>
                <p><span class="float1">电&nbsp;&nbsp;&nbsp;&nbsp;话：</span><span class="supplier_company_name1"><?php echo $SHOP['telphone'];?></span>
                	<div class="clear"></div>
                </p>
                <p>移动电话：
<?php if (isset($this->controller->my->id)) { ?><?php echo $SHOP['mobile'];?><?php }else{ ?><a href="<?php echo $this->_url('user/login');?>" class="lookafterlogin1 toLoginBtn" >登录后可见</a><?php } ?>				
				</p>
                <p>传&nbsp;&nbsp;&nbsp;&nbsp;真：<?php echo $SHOP['fax'];?></p>
                <p>邮政编码：<?php echo $SHOP['zipcode'];?></p>				
				
            </div>
            <div style="width:180px; height:120px;padding: 1px 1px 1px 2px;">			
                <!--			
                <div id="map_canvas" style="width:204px; height:120px;" ></div>
				-->
				<iframe src="<?php echo $this->_url('googlemap/showggmap/');?>?position=<?php echo $SHOP['map_x'];?>,<?php echo $SHOP['map_y'];?>"  width="204" height="120" scrolling="no" frameborder="0" ></iframe>
			</div>
        </div>
        <!-- 联系方式 end -->     
        
        <!-- 友情链接 -->
        <div class="supplier_message margintop1">
        	<div class="supplier_message_hd">
            	<span class="supplier_tab">商家推荐</span>
            </div>
            <div class="link_list1">
			    <?php foreach($shoplinks as $value) { $value=$value['shoplinks']; ?>
                <a href="<?php echo $value['url'];?>" target="<?php echo $value['target'];?>" ><?php echo $value['name'];?></a>
				<?php } ?>			    
        		<div class="clear"></div>
            </div>            
        </div>
        <!-- 友情链接 end -->
        
        <div class="clear"></div>
        
    </div>
	<!-- main_left end -->

	<!-- main_right -->
	<div id="main_right">   
    	<div class="product-info-box"> 
        
            <div class="product-crumbs">
            	<div class="product-crumbs-left">
				<a href="#">首页</a>
				<?php foreach($sub_category as $value){?>
				&gt;<a href="<?php echo $value['url'];?>"><?php echo $value['cat_name'];?></a>
				<?php }?>				
                </div>
                <div class="product-crumbs-right">
                	购物提醒:<a href="#">安全交易指南</a>|<a class="jubao-icon" href="#">举报该信息</a>
                </div>
                <div class="clear"></div>
            </div>
            
            <div class="product-title"><?php echo  $goodsinfo['goods']['goods_name'];?></div>
            
            <div class="product-info-left">
            	<ul class="product-imgs">
                	<li class="product-info-img" style="display:block;">
                    <a id="zoom1" href="<?php echo $gallery['0']['goodsgallery']['img_original'];?>" rel="adjustX:10, adjustY:-4" class="cloud-zoom">
                    	<img src="<?php echo $gallery['0']['goodsgallery']['img_url']; ?>" width="270" height="270" />
                    </a>
                    </li>					
                    <!--<li class="product-info-img"><img src="photo/map2.jpg" width="270" height="270" /></li>
                    <li class="product-info-img"><img src="photo/scroll_small_img1.gif" width="270" height="270" /></li>
                    <li class="product-info-img"><img src="photo/ddddd.jpg" width="270" height="270" /></li>
                    <li class="product-info-img"><img src="photo/scroll_small_img1.gif" width="270" height="270" /></li>
                    <li class="product-info-img"><img src="photo/recommend_prot_img2.gif" width="270" height="270" /></li>
                    <li class="product-info-img"><img src="photo/scroll_small_img1.gif" width="270" height="270" /></li>-->
                </ul>	
            	
                <div class="product-simgs-box">
                	<a href="#" class="product-simgs-left-btn"></a>
                    <div class="product-tab-list-box">
                    <ul class="product-tab-list">
                    	<li class="on">
                        	<div class="product-tab-list-item">
                        	<a href="<?php echo $gallery['0']['goodsgallery']['img_original'];?>" class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: '<?php echo $gallery['0']['goodsgallery']['img_url']; ?>' ">
                            	<img src="<?php echo $gallery['0']['goodsgallery']['thumb_url']; ?>" width="58" height="58" />
                        	</a>    
                        	</div><b></b>
                        </li>
						<?php foreach( $gallery as $val) {?>
                        <li>
                        	<div class="product-tab-list-item">
                            	<a href="<?php echo $val['goodsgallery']['img_original'];?>" class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: '<?php echo $val['goodsgallery']['img_url']; ?>' ">
                            	<img src="<?php echo $val['goodsgallery']['thumb_url']; ?>" width="58" height="58" />
                                </a>
                            </div><b></b>
                        </li>
						<?php } ?>

                    </ul>
                    </div>
                    <a href="#" class="product-simgs-right-btn"></a>
                    <div class="clear"></div>
                </div>
                
                <div class="p-all-num-box">
                	<a href="#" class="dianji">点击率(<?php echo $goodsinfo['goods']['pv']; ?>)</a>
                    <a href="#" class="pinglun">好评数(<?php echo $goods_credit;?>)</a>
                    <a href="javascript:addFavorite(<?php echo $goodsinfo['goods']['id']; ?>);" class="shoucang" style="color:red;">收藏(<span id="favpv"><?php echo  $goodsinfo['goods']['favpv'];?></span>)</a>
                    <!--<a href="#" class="liulanliang">顾客浏览量(2000)</a>-->
                </div>
            </div>
            
            <div class="product-info-right">
            	<div class="weight-price">
                	<div class="weight">订货量(件)</div>
                    <div class="price">价格(不含税/不含运费)</div>
                </div>
                <div class="weight-price weight-price-num">
                	<div class="weight">&ge;1</div>
                    <div class="price">
                    <?php  if($goodsinfo['goods']['goods_price']=='0.00') {?> 
					<span>面议</span> 
					<?php  } else{?>
					<span><?php echo  $goodsinfo['goods']['goods_price'];?></span>元/件
					<?php }?>					
					</div>
                </div>
 <!--               
                <div class="product-info-item">
                	<div class="product-info-item-left">供货方式：</div>
                    <div class="product-info-item-right">现货(2天内发货)</div>
                </div>
-->				
                <div class="product-info-item">
                	<div class="product-info-item-left">发货地：</div>
                    <div class="product-info-item-right"><?php echo  $areainfo[$SHOP['shop_province']];?>.<?php echo  $areainfo[$SHOP['shop_city']];?>.<?php echo  $areainfo[$SHOP['shop_district']];?></div>
                </div>
                <div class="product-info-item">
                	<div class="product-info-item-left">商品满意度：</div>
                    <div class="product-info-item-right product-info-item-right-star">
                    	<div class="stars-box">
                        <?php for($i=1; $i<(($goods_credit/$goods_sell)*10); $i++) { ?>
						<img class="stars" src="<?php echo $this->_webroot('images/star.jpg');?>" />
						<?php } ?>						
                    	</div>
                        <span>（商品好评数:<?php echo $goods_credit;?>）</span>
                    </div>
                </div>
                <div class="product-info-item">
                	<div class="product-info-item-left">付款方式：</div>					
                    <div class="product-info-item-right">
                            <?php  if($payment_info) {?>
							<?php foreach($payment_info as $val){?><?php echo $val;?>&nbsp;&nbsp;<?php }?>
							<?php  } else{?> 此商家没有开通任何一种支付方式<?php }?> 					
					</div>
                </div>
                <div class="product-info-item">
                	<div class="product-info-item-left">保障服务：</div>
                    <div class="product-info-item-right baozhang-box">
			<?php if($ensure) {
				foreach($ensure as $val) { $val =$val['ensure']; ?>
				    <?php if( isset( $userensure[$val['id']]) && $userensure[$val['id']]['istui']==0 ) { ?>
                      <a class="baozhang" href="#"><img src="<?php echo $val['picurl']?>" /></a>
                    <?php } ?>						    
				<?php }?>
			<?php }?>					

					</div>
                </div>
                <div class="product-info-item product-info-item-order-box">
                	<div class="product-info-item-left">我要订购：</div>
                    <div class="product-info-item-right">
                    	<input class="input-p-num" type="text" value="1" name=""  id='num'/>件
                    	<div class="add-cut-box"><a href="#" class="add-order-p"><img src="<?php echo $this->_webroot('images/p-add-num.jpg');?>" /></a><a href="#" class="cut-order-p"><img src="<?php echo $this->_webroot('images/p-cut-num.jpg');?>" /></a></div>
                    </div>
                </div>
                <div class="product-info-item">
                	<a class="buy-now" href="javascript:gotoOrder(<?php echo $goodsinfo['goods']['id'] ;?>);">立即购买</a>
                    <a class="add-order "  href="javascript:addCart(<?php echo $goodsinfo['goods']['id'] ;?>);">加入订单</a>
                    <div class="clear"></div>
                </div>
                <div class="product-info-item stock-info">
                	(<span>库存数量：<?php echo $goodsinfo['goods']['goods_number'] ;?>件</span><span class="ljsl">累计售出数量：<?php echo $goods_sell ; ?>件</span>)
                </div>
            </div>
            
            <div class="clear"></div>
        </div>
        
        <div class="evaluate-box">
        	<div class="evaluate-box-hd">
            	<ul class="evaluate-tab-box">
                	<li class="first on"><div class="evaluate-tab-right-bg">详细信息</div></li>
                    <li style="width:109px;"><div class="evaluate-tab-right-bg">批发说明</div></li>					
                    <li style="width:109px;"><div class="evaluate-tab-right-bg">商品评价</div></li>
                    <li style="width:109px;"><div class="evaluate-tab-right-bg">成交记录</div></li>
                </ul>
                <div class="clear"></div>
            </div>
            
            <div class="evaluate-body">
            	<div class="evaluate-body-hd">
                	<div class="title-evaluate">评价等级</div>
                    <div class="title-discuss">评价内容</div>
                    <div class="title-appraiser">评价人</div>
                    <div class="title-information">卖家解释</div>
                    <div class="title-operate">解释时间</div>
                    <div class="clear"></div>
                </div>
                
                
                <div class="product-detail-box" style="display:block;">
                	<div class="product-detail">
                    	<table  width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#e5e5e5" style="border-collapse:collapse;">
						<tr>
                        <?php 
						if($attr_status) {
						$i = 0;
						foreach($attr as $key=>$value){?>
						<td class="lable" width="86"><?php echo  $attribute[$key];?>:</td>
						<td class="text"><?php echo  $value;?></td>
						<?php 
						if($i%2) {
						echo "</tr>
					<tr>";
						}
						$i++;
						
						} }?> 						
						</tr>
							
                           <!-- <tr><td class="lable">类型</td><td class="text">服装</td><td class="lable">品牌</td><td class="text">大品牌</td></tr>-->

                        </table>
                        
                       <!-- <div style="text-align:center; font-size:24px; color:#858585; padding:18px 0px;"><?php echo  $SHOP['shop_name'];?></div>-->
                        <?php echo  $goodsinfo['goods']['goods_intro'];?>
                    </div>
                </div>
                
                 <div class="product-detail-box">
				    <div class="product-detail">
                        <p><?php echo  $goodsinfo['goods']['goods_wholesale'];?> </p>
					</div>	
            	</div>               
                
                <div class="product-detail-box">
				<?php 
				$goods_id = $goodsinfo['goods']['id'];
				$loadimg = $this->_webroot('images1/ico_loading3.gif');
				$page = intval(Request::get_args('page'));				
				?>
				<psp:frame controller='shop' action='goodcredit'  iframeid='good_credit' loadimg='$loadimg'  query='good_id=$goods_id&page=$page' />
				  
            	</div>                
                
                <div class="product-detail-box">
				<psp:frame controller='shop' action='goodrecord'  iframeid='good_record' loadimg='$loadimg'  query='good_id=$goods_id' />
				  
            	</div>              

                
                
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    <!-- main_right end -->
    
	<div class="clear"></div>
</div>



<div class="clear"></div>

<psp:tags     htmlname='default_footer'  iconname='defaultfooter' />
<psp:tags     htmlname='shopservice_qq'  iconname='shopservice_qq' />

<script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAPMb9i-xfXea2BhwglLD6vhQQfXL1E26uZVzpSr4bnBOO5ggYXxTJ8o5DOfAanEM5dHhSGnAhnn526Q" type="text/javascript"></script>
<script language="JavaScript">
<!--
/*
// 地图处理开始
var now_x = <?php echo $SHOP['map_x'];?>;
var now_y = <?php echo $SHOP['map_y'];?>;
var now_zoom = <?php echo $SHOP['map_zoom'];?>;

if(now_x=='0' && now_y=='0'){
	var now_x = '116.39328002929687';
	var now_y = '39.89709437260048';
	var now_zoom = '5';
}

function initialize() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map_canvas"));
		var center = new GLatLng(now_y, now_x);
		map.setCenter(center, now_zoom);

		var point = new GLatLng(now_y,now_x);
		var marker = new GMarker(point);
		map.addOverlay(marker);

		GEvent.addListener(map,"click", function(overlay,latlng) {
			if(latlng) {
				var point = new GLatLng(latlng.y,latlng.x); // 根据经纬度创建点
				var marker = new GMarker(point);			// 创建标注
				map.clearOverlays();						// 清除现有地图上的所有标注
				map.addOverlay(marker);						// 添加新标注

				now_x = latlng.x;
				now_y = latlng.y;
				now_zoom = map.getZoom();

				document.getElementById('now_x').value=now_x;
				document.getElementById('now_y').value=now_y;
				document.getElementById('now_zoom').value=now_zoom;
			}
		});

		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
	}
}

// 地图处理结束
*/

//-->
</script>
</body>
</html>